Integrand size = 13, antiderivative size = 138 \[ \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx=\frac {2 a^4 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{(a-b)^{5/2} (a+b)^{5/2}}+\frac {a^3 \cot (x)}{\left (a^2-b^2\right )^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}-\frac {a^2 b \csc (x)}{\left (a^2-b^2\right )^2}-\frac {b \csc (x)}{a^2-b^2}+\frac {b \csc ^3(x)}{3 \left (a^2-b^2\right )} \]
2*a^4*arctan((a-b)^(1/2)*tan(1/2*x)/(a+b)^(1/2))/(a-b)^(5/2)/(a+b)^(5/2)+a ^3*cot(x)/(a^2-b^2)^2-1/3*a*cot(x)^3/(a^2-b^2)-a^2*b*csc(x)/(a^2-b^2)^2-b* csc(x)/(a^2-b^2)+1/3*b*csc(x)^3/(a^2-b^2)
Time = 0.47 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.81 \[ \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx=-\frac {2 a^4 \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\left (-a^2+b^2\right )^{5/2}}-\frac {\left (-3 a b^2 \cos (x)+6 b \left (-2 a^2+b^2\right ) \cos (2 x)+\left (4 a^2-b^2\right ) (2 b+a \cos (3 x))\right ) \csc ^3(x)}{12 (a-b)^2 (a+b)^2} \]
(-2*a^4*ArcTanh[((a - b)*Tan[x/2])/Sqrt[-a^2 + b^2]])/(-a^2 + b^2)^(5/2) - ((-3*a*b^2*Cos[x] + 6*b*(-2*a^2 + b^2)*Cos[2*x] + (4*a^2 - b^2)*(2*b + a* Cos[3*x]))*Csc[x]^3)/(12*(a - b)^2*(a + b)^2)
Time = 0.83 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.09, number of steps used = 20, number of rules used = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.462, Rules used = {3042, 3206, 25, 3042, 25, 3086, 2009, 3087, 15, 3206, 25, 3042, 25, 3086, 24, 3138, 218, 4254, 24}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan \left (x-\frac {\pi }{2}\right )^4}{a-b \sin \left (x-\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 3206 |
\(\displaystyle -\frac {a^2 \int \frac {\cot ^2(x)}{a+b \cos (x)}dx}{a^2-b^2}+\frac {b \int -\cot ^3(x) \csc (x)dx}{a^2-b^2}+\frac {a \int \cot ^2(x) \csc ^2(x)dx}{a^2-b^2}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {a^2 \int \frac {\cot ^2(x)}{a+b \cos (x)}dx}{a^2-b^2}-\frac {b \int \cot ^3(x) \csc (x)dx}{a^2-b^2}+\frac {a \int \cot ^2(x) \csc ^2(x)dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {a^2 \int \frac {\tan \left (x-\frac {\pi }{2}\right )^2}{a-b \sin \left (x-\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \sec \left (x-\frac {\pi }{2}\right )^2 \tan \left (x-\frac {\pi }{2}\right )^2dx}{a^2-b^2}-\frac {b \int -\sec \left (x-\frac {\pi }{2}\right ) \tan \left (x-\frac {\pi }{2}\right )^3dx}{a^2-b^2}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {a^2 \int \frac {\tan \left (x-\frac {\pi }{2}\right )^2}{a-b \sin \left (x-\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \sec \left (x-\frac {\pi }{2}\right )^2 \tan \left (x-\frac {\pi }{2}\right )^2dx}{a^2-b^2}+\frac {b \int \sec \left (x-\frac {\pi }{2}\right ) \tan \left (x-\frac {\pi }{2}\right )^3dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3086 |
\(\displaystyle \frac {b \int \left (\csc ^2(x)-1\right )d\csc (x)}{a^2-b^2}-\frac {a^2 \int \frac {\tan \left (x-\frac {\pi }{2}\right )^2}{a-b \sin \left (x-\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \sec \left (x-\frac {\pi }{2}\right )^2 \tan \left (x-\frac {\pi }{2}\right )^2dx}{a^2-b^2}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {a^2 \int \frac {\tan \left (x-\frac {\pi }{2}\right )^2}{a-b \sin \left (x-\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \sec \left (x-\frac {\pi }{2}\right )^2 \tan \left (x-\frac {\pi }{2}\right )^2dx}{a^2-b^2}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 3087 |
\(\displaystyle \frac {a \int \cot ^2(x)d(-\cot (x))}{a^2-b^2}-\frac {a^2 \int \frac {\tan \left (x-\frac {\pi }{2}\right )^2}{a-b \sin \left (x-\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 15 |
\(\displaystyle -\frac {a^2 \int \frac {\tan \left (x-\frac {\pi }{2}\right )^2}{a-b \sin \left (x-\frac {\pi }{2}\right )}dx}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 3206 |
\(\displaystyle -\frac {a^2 \left (-\frac {a^2 \int \frac {1}{a+b \cos (x)}dx}{a^2-b^2}+\frac {a \int \csc ^2(x)dx}{a^2-b^2}+\frac {b \int -\cot (x) \csc (x)dx}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {a^2 \left (-\frac {a^2 \int \frac {1}{a+b \cos (x)}dx}{a^2-b^2}+\frac {a \int \csc ^2(x)dx}{a^2-b^2}-\frac {b \int \cot (x) \csc (x)dx}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {a^2 \left (-\frac {a^2 \int \frac {1}{a+b \sin \left (x+\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \csc (x)^2dx}{a^2-b^2}-\frac {b \int -\sec \left (x-\frac {\pi }{2}\right ) \tan \left (x-\frac {\pi }{2}\right )dx}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {a^2 \left (-\frac {a^2 \int \frac {1}{a+b \sin \left (x+\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \csc (x)^2dx}{a^2-b^2}+\frac {b \int \sec \left (x-\frac {\pi }{2}\right ) \tan \left (x-\frac {\pi }{2}\right )dx}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 3086 |
\(\displaystyle -\frac {a^2 \left (-\frac {a^2 \int \frac {1}{a+b \sin \left (x+\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \csc (x)^2dx}{a^2-b^2}+\frac {b \int 1d\csc (x)}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle -\frac {a^2 \left (-\frac {a^2 \int \frac {1}{a+b \sin \left (x+\frac {\pi }{2}\right )}dx}{a^2-b^2}+\frac {a \int \csc (x)^2dx}{a^2-b^2}+\frac {b \csc (x)}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle -\frac {a^2 \left (-\frac {2 a^2 \int \frac {1}{(a-b) \tan ^2\left (\frac {x}{2}\right )+a+b}d\tan \left (\frac {x}{2}\right )}{a^2-b^2}+\frac {a \int \csc (x)^2dx}{a^2-b^2}+\frac {b \csc (x)}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle -\frac {a^2 \left (\frac {a \int \csc (x)^2dx}{a^2-b^2}-\frac {2 a^2 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} \left (a^2-b^2\right )}+\frac {b \csc (x)}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle -\frac {a^2 \left (-\frac {a \int 1d\cot (x)}{a^2-b^2}-\frac {2 a^2 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} \left (a^2-b^2\right )}+\frac {b \csc (x)}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle -\frac {a^2 \left (-\frac {2 a^2 \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b} \left (a^2-b^2\right )}-\frac {a \cot (x)}{a^2-b^2}+\frac {b \csc (x)}{a^2-b^2}\right )}{a^2-b^2}-\frac {a \cot ^3(x)}{3 \left (a^2-b^2\right )}+\frac {b \left (\frac {\csc ^3(x)}{3}-\csc (x)\right )}{a^2-b^2}\) |
-1/3*(a*Cot[x]^3)/(a^2 - b^2) - (a^2*((-2*a^2*ArcTan[(Sqrt[a - b]*Tan[x/2] )/Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]*(a^2 - b^2)) - (a*Cot[x])/(a^2 - b^2) + (b*Csc[x])/(a^2 - b^2)))/(a^2 - b^2) + (b*(-Csc[x] + Csc[x]^3/3))/( a^2 - b^2)
3.1.17.3.1 Defintions of rubi rules used
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( n_.), x_Symbol] :> Simp[a/f Subst[Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2 ), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2 ] && !(IntegerQ[m/2] && LtQ[0, m, n + 1])
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S ymbol] :> Simp[1/f Subst[Int[(b*x)^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] && !(IntegerQ[(n - 1) /2] && LtQ[0, n, m - 1])
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[a/(a^2 - b^2) Int[(g*Tan[e + f*x])^p/Sin[e + f*x] ^2, x], x] + (-Simp[b*(g/(a^2 - b^2)) Int[(g*Tan[e + f*x])^(p - 1)/Cos[e + f*x], x], x] - Simp[a^2*(g^2/(a^2 - b^2)) Int[(g*Tan[e + f*x])^(p - 2)/ (a + b*Sin[e + f*x]), x], x]) /; FreeQ[{a, b, e, f, g}, x] && NeQ[a^2 - b^2 , 0] && IntegersQ[2*p] && GtQ[p, 1]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Time = 1.36 (sec) , antiderivative size = 127, normalized size of antiderivative = 0.92
method | result | size |
default | \(\frac {\frac {a \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{3}-\frac {b \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{3}-5 a \tan \left (\frac {x}{2}\right )+3 b \tan \left (\frac {x}{2}\right )}{8 \left (a -b \right )^{2}}+\frac {2 a^{4} \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {x}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {1}{24 \left (a +b \right ) \tan \left (\frac {x}{2}\right )^{3}}-\frac {-5 a -3 b}{8 \left (a +b \right )^{2} \tan \left (\frac {x}{2}\right )}\) | \(127\) |
risch | \(-\frac {2 i \left (6 a^{2} b \,{\mathrm e}^{5 i x}-3 b^{3} {\mathrm e}^{5 i x}-6 a^{3} {\mathrm e}^{4 i x}+3 a \,b^{2} {\mathrm e}^{4 i x}-8 a^{2} b \,{\mathrm e}^{3 i x}+2 b^{3} {\mathrm e}^{3 i x}+6 a^{3} {\mathrm e}^{2 i x}+6 a^{2} b \,{\mathrm e}^{i x}-3 b^{3} {\mathrm e}^{i x}-4 a^{3}+a \,b^{2}\right )}{3 \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \left ({\mathrm e}^{2 i x}-1\right )^{3}}-\frac {a^{4} \ln \left ({\mathrm e}^{i x}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}+\frac {a^{4} \ln \left ({\mathrm e}^{i x}+\frac {-i a^{2}+i b^{2}+a \sqrt {-a^{2}+b^{2}}}{\sqrt {-a^{2}+b^{2}}\, b}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}\) | \(287\) |
1/8/(a-b)^2*(1/3*a*tan(1/2*x)^3-1/3*b*tan(1/2*x)^3-5*a*tan(1/2*x)+3*b*tan( 1/2*x))+2/(a-b)^2/(a+b)^2*a^4/((a-b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*x)/ ((a-b)*(a+b))^(1/2))-1/24/(a+b)/tan(1/2*x)^3-1/8/(a+b)^2*(-5*a-3*b)/tan(1/ 2*x)
Time = 0.33 (sec) , antiderivative size = 456, normalized size of antiderivative = 3.30 \[ \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx=\left [-\frac {10 \, a^{4} b - 14 \, a^{2} b^{3} + 4 \, b^{5} + 2 \, {\left (4 \, a^{5} - 5 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (x\right )^{3} - 3 \, {\left (a^{4} \cos \left (x\right )^{2} - a^{4}\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (x\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (x\right ) + b\right )} \sin \left (x\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}}\right ) \sin \left (x\right ) - 6 \, {\left (2 \, a^{4} b - 3 \, a^{2} b^{3} + b^{5}\right )} \cos \left (x\right )^{2} - 6 \, {\left (a^{5} - a^{3} b^{2}\right )} \cos \left (x\right )}{6 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6} - {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}, -\frac {5 \, a^{4} b - 7 \, a^{2} b^{3} + 2 \, b^{5} + {\left (4 \, a^{5} - 5 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (x\right )^{3} + 3 \, {\left (a^{4} \cos \left (x\right )^{2} - a^{4}\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (x\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (x\right )}\right ) \sin \left (x\right ) - 3 \, {\left (2 \, a^{4} b - 3 \, a^{2} b^{3} + b^{5}\right )} \cos \left (x\right )^{2} - 3 \, {\left (a^{5} - a^{3} b^{2}\right )} \cos \left (x\right )}{3 \, {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6} - {\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}\right ] \]
[-1/6*(10*a^4*b - 14*a^2*b^3 + 4*b^5 + 2*(4*a^5 - 5*a^3*b^2 + a*b^4)*cos(x )^3 - 3*(a^4*cos(x)^2 - a^4)*sqrt(-a^2 + b^2)*log((2*a*b*cos(x) + (2*a^2 - b^2)*cos(x)^2 + 2*sqrt(-a^2 + b^2)*(a*cos(x) + b)*sin(x) - a^2 + 2*b^2)/( b^2*cos(x)^2 + 2*a*b*cos(x) + a^2))*sin(x) - 6*(2*a^4*b - 3*a^2*b^3 + b^5) *cos(x)^2 - 6*(a^5 - a^3*b^2)*cos(x))/((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6 - (a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*cos(x)^2)*sin(x)), -1/3*(5*a^4*b - 7 *a^2*b^3 + 2*b^5 + (4*a^5 - 5*a^3*b^2 + a*b^4)*cos(x)^3 + 3*(a^4*cos(x)^2 - a^4)*sqrt(a^2 - b^2)*arctan(-(a*cos(x) + b)/(sqrt(a^2 - b^2)*sin(x)))*si n(x) - 3*(2*a^4*b - 3*a^2*b^3 + b^5)*cos(x)^2 - 3*(a^5 - a^3*b^2)*cos(x))/ ((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6 - (a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)* cos(x)^2)*sin(x))]
\[ \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx=\int \frac {\cot ^{4}{\left (x \right )}}{a + b \cos {\left (x \right )}}\, dx \]
Exception generated. \[ \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
Time = 0.30 (sec) , antiderivative size = 210, normalized size of antiderivative = 1.52 \[ \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx=-\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, x\right ) - b \tan \left (\frac {1}{2} \, x\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} a^{4}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} - b^{2}}} + \frac {a^{2} \tan \left (\frac {1}{2} \, x\right )^{3} - 2 \, a b \tan \left (\frac {1}{2} \, x\right )^{3} + b^{2} \tan \left (\frac {1}{2} \, x\right )^{3} - 15 \, a^{2} \tan \left (\frac {1}{2} \, x\right ) + 24 \, a b \tan \left (\frac {1}{2} \, x\right ) - 9 \, b^{2} \tan \left (\frac {1}{2} \, x\right )}{24 \, {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )}} + \frac {15 \, a \tan \left (\frac {1}{2} \, x\right )^{2} + 9 \, b \tan \left (\frac {1}{2} \, x\right )^{2} - a - b}{24 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \tan \left (\frac {1}{2} \, x\right )^{3}} \]
-2*(pi*floor(1/2*x/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*x) - b*t an(1/2*x))/sqrt(a^2 - b^2)))*a^4/((a^4 - 2*a^2*b^2 + b^4)*sqrt(a^2 - b^2)) + 1/24*(a^2*tan(1/2*x)^3 - 2*a*b*tan(1/2*x)^3 + b^2*tan(1/2*x)^3 - 15*a^2 *tan(1/2*x) + 24*a*b*tan(1/2*x) - 9*b^2*tan(1/2*x))/(a^3 - 3*a^2*b + 3*a*b ^2 - b^3) + 1/24*(15*a*tan(1/2*x)^2 + 9*b*tan(1/2*x)^2 - a - b)/((a^2 + 2* a*b + b^2)*tan(1/2*x)^3)
Time = 14.33 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.33 \[ \int \frac {\cot ^4(x)}{a+b \cos (x)} \, dx=\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{3\,\left (8\,a-8\,b\right )}-\mathrm {tan}\left (\frac {x}{2}\right )\,\left (\frac {4}{8\,a-8\,b}+\frac {8\,a+8\,b}{{\left (8\,a-8\,b\right )}^2}\right )-\frac {\frac {a^2-2\,a\,b+b^2}{3\,\left (a+b\right )}+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\left (-5\,a^3+7\,a^2\,b+a\,b^2-3\,b^3\right )}{{\left (a+b\right )}^2}}{{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,\left (8\,a^2-16\,a\,b+8\,b^2\right )}+\frac {2\,a^4\,\mathrm {atan}\left (\frac {\mathrm {tan}\left (\frac {x}{2}\right )\,\left (a^4-2\,a^2\,b^2+b^4\right )}{{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{3/2}}\right )}{{\left (a+b\right )}^{5/2}\,{\left (a-b\right )}^{5/2}} \]
tan(x/2)^3/(3*(8*a - 8*b)) - tan(x/2)*(4/(8*a - 8*b) + (8*a + 8*b)/(8*a - 8*b)^2) - ((a^2 - 2*a*b + b^2)/(3*(a + b)) + (tan(x/2)^2*(a*b^2 + 7*a^2*b - 5*a^3 - 3*b^3))/(a + b)^2)/(tan(x/2)^3*(8*a^2 - 16*a*b + 8*b^2)) + (2*a^ 4*atan((tan(x/2)*(a^4 + b^4 - 2*a^2*b^2))/((a + b)^(5/2)*(a - b)^(3/2))))/ ((a + b)^(5/2)*(a - b)^(5/2))